home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / CMICCProfile.p < prev    next >
Encoding:
Text File  |  1998-02-12  |  27.2 KB  |  822 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CMICCProfile.p
  3.  
  4.      Contains:    ICC Profile Format Definitions
  5.  
  6.      Version:    Technology:    ColorSync 2.5
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1994-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT CMICCProfile;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __CMICCPROFILE__}
  28. {$SETC __CMICCPROFILE__ := 1}
  29.  
  30. {$I+}
  31. {$SETC CMICCProfileIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __MACTYPES__}
  35. {$I MacTypes.p}
  36. {$ENDC}
  37.  
  38.  
  39. {$PUSH}
  40. {$ALIGN MAC68K}
  41. {$LibExport+}
  42.  
  43. { Current CMProfile.header.profileVersion Major: 2, Minor: 0, Stage: Developement (x20), Prerelease:0x01 }
  44.  
  45. CONST
  46.     cmCS2ProfileVersion            = $02000000;
  47.  
  48. { Current Major version number }
  49.     cmCurrentProfileMajorVersion = $02000000;
  50.  
  51. { magic cookie number for anonymous file ID }
  52.     cmMagicNumber                = 'acsp';
  53.  
  54. { ColorSync profile version 1.0 }
  55.     cmCS1ProfileVersion            = $00000100;
  56.  
  57.  
  58. {**********************************************************************}
  59. {************** ColorSync 2.0 profile specification *******************}
  60. {**********************************************************************}
  61. {*** flags field  ***}
  62.     cmICCReservedFlagsMask        = $0000FFFF;                    {  these bits of the flags field are defined and reserved by ICC  }
  63.     cmEmbeddedMask                = $00000001;                    {  if bit 0 is 0 then not embedded profile, if 1 then embedded profile  }
  64.     cmEmbeddedUseMask            = $00000002;                    {  if bit 1 is 0 then ok to use anywhere, if 1 then ok to use as embedded profile only  }
  65.     cmCMSReservedFlagsMask        = $FFFF0000;                    {  these bits of the flags field are defined and reserved by CMS vendor  }
  66.     cmQualityMask                = $00030000;                    {  if bits 16-17 is 0 then normal, if 1 then draft, if 2 then best  }
  67.     cmInterpolationMask            = $00040000;                    {  if bit 18 is 0 then interpolation, if 1 then lookup only  }
  68.     cmGamutCheckingMask            = $00080000;                    {  if bit 19 is 0 then create gamut checking info, if 1 then no gamut checking info  }
  69.  
  70. { copyright-protection flag options }
  71.     cmEmbeddedProfile            = 0;                            {  0 is not embedded profile, 1 is embedded profile  }
  72.     cmEmbeddedUse                = 1;                            {  0 is to use anywhere, 1 is to use as embedded profile only  }
  73.  
  74. { speed and quality flag options }
  75.     cmNormalMode                = 0;                            {  it uses the least significent two bits in the high word of flag  }
  76.     cmDraftMode                    = 1;                            {  it should be evaulated like this: right shift 16 bits first, mask off the  }
  77.     cmBestMode                    = 2;                            {  high 14 bits, and then compare with the enum to determine the option value  }
  78.  
  79.  
  80. {*** deviceAttributes fields ***}
  81.     cmICCReservedAttr0Mask        = $0000FFFF;                    {  these bits of the deviceAttributes[0] field are defined and reserved by ICC  }
  82.     cmReflectiveTransparentMask    = $00000001;                    {  if bit 0 is 0 then reflective media, if 1 then transparency media  }
  83.     cmGlossyMatteMask            = $00000002;                    {  if bit 1 is 0 then glossy, if 1 then matte  }
  84.     cmVendorReservedAttr0Mask    = $FFFF0000;                    {  these bits of the deviceAttributes[0] field are defined and reserved by device vendor  }
  85.     cmVendorReservedAttr1Mask    = $FFFFFFFF;                    {  these bits of the deviceAttributes[1] field are defined and reserved by device vendor  }
  86.  
  87. { device/media attributes element values  }
  88.     cmReflective                = 0;                            {  if bit 0 is 0 then reflective media, if 1 then transparency media  }
  89.     cmGlossy                    = 1;                            {  if bit 1 is 0 then glossy, if 1 then matte  }
  90.  
  91.  
  92. {*** renderingIntent field ***}
  93.     cmPerceptual                = 0;                            {  Photographic images  }
  94.     cmRelativeColorimetric        = 1;                            {  Logo Colors  }
  95.     cmSaturation                = 2;                            {  Business graphics  }
  96.     cmAbsoluteColorimetric        = 3;                            {  Logo Colors  }
  97.  
  98.  
  99.  
  100. { data type element values }
  101.     cmAsciiData                    = 0;
  102.     cmBinaryData                = 1;
  103.  
  104. { screen encodings  }
  105.     cmPrtrDefaultScreens        = 0;                            {  Use printer default screens.  0 is false, 1 is ture  }
  106.     cmLinesPer                    = 1;                            {  0 is LinesPerCm, 1 is LinesPerInch  }
  107.  
  108. { 2.0 tag type information }
  109.     cmNumHeaderElements            = 10;
  110.  
  111. { public tags }
  112.     cmAToB0Tag                    = 'A2B0';
  113.     cmAToB1Tag                    = 'A2B1';
  114.     cmAToB2Tag                    = 'A2B2';
  115.     cmBlueColorantTag            = 'bXYZ';
  116.     cmBlueTRCTag                = 'bTRC';
  117.     cmBToA0Tag                    = 'B2A0';
  118.     cmBToA1Tag                    = 'B2A1';
  119.     cmBToA2Tag                    = 'B2A2';
  120.     cmCalibrationDateTimeTag    = 'calt';
  121.     cmCharTargetTag                = 'targ';
  122.     cmCopyrightTag                = 'cprt';
  123.     cmDeviceMfgDescTag            = 'dmnd';
  124.     cmDeviceModelDescTag        = 'dmdd';
  125.     cmGamutTag                    = 'gamt';
  126.     cmGrayTRCTag                = 'kTRC';
  127.     cmGreenColorantTag            = 'gXYZ';
  128.     cmGreenTRCTag                = 'gTRC';
  129.     cmLuminanceTag                = 'lumi';
  130.     cmMeasurementTag            = 'meas';
  131.     cmMediaBlackPointTag        = 'bkpt';
  132.     cmMediaWhitePointTag        = 'wtpt';
  133.     cmNamedColorTag                = 'ncol';
  134.     cmNamedColor2Tag            = 'ncl2';
  135.     cmPreview0Tag                = 'pre0';
  136.     cmPreview1Tag                = 'pre1';
  137.     cmPreview2Tag                = 'pre2';
  138.     cmProfileDescriptionTag        = 'desc';
  139.     cmProfileSequenceDescTag    = 'pseq';
  140.     cmPS2CRD0Tag                = 'psd0';
  141.     cmPS2CRD1Tag                = 'psd1';
  142.     cmPS2CRD2Tag                = 'psd2';
  143.     cmPS2CRD3Tag                = 'psd3';
  144.     cmPS2CSATag                    = 'ps2s';
  145.     cmPS2RenderingIntentTag        = 'ps2i';
  146.     cmRedColorantTag            = 'rXYZ';
  147.     cmRedTRCTag                    = 'rTRC';
  148.     cmScreeningDescTag            = 'scrd';
  149.     cmScreeningTag                = 'scrn';
  150.     cmTechnologyTag                = 'tech';
  151.     cmUcrBgTag                    = 'bfd ';
  152.     cmViewingConditionsDescTag    = 'vued';
  153.     cmViewingConditionsTag        = 'view';
  154.  
  155. { custom tags }
  156.     cmPS2CRDVMSizeTag            = 'psvm';
  157.     cmVideoCardGammaTag            = 'vcgt';
  158.  
  159. { technology tag descriptions }
  160.     cmTechnologyFilmScanner        = 'fscn';
  161.     cmTechnologyReflectiveScanner = 'rscn';
  162.     cmTechnologyInkJetPrinter    = 'ijet';
  163.     cmTechnologyThermalWaxPrinter = 'twax';
  164.     cmTechnologyElectrophotographicPrinter = 'epho';
  165.     cmTechnologyElectrostaticPrinter = 'esta';
  166.     cmTechnologyDyeSublimationPrinter = 'dsub';
  167.     cmTechnologyPhotographicPaperPrinter = 'rpho';
  168.     cmTechnologyFilmWriter        = 'fprn';
  169.     cmTechnologyVideoMonitor    = 'vidm';
  170.     cmTechnologyVideoCamera        = 'vidc';
  171.     cmTechnologyProjectionTelevision = 'pjtv';
  172.     cmTechnologyCRTDisplay        = 'CRT ';
  173.     cmTechnologyPMDisplay        = 'PMD ';
  174.     cmTechnologyAMDisplay        = 'AMD ';
  175.     cmTechnologyPhotoCD            = 'KPCD';
  176.     cmTechnologyPhotoImageSetter = 'imgs';
  177.     cmTechnologyGravure            = 'grav';
  178.     cmTechnologyOffsetLithography = 'offs';
  179.     cmTechnologySilkscreen        = 'silk';
  180.     cmTechnologyFlexography        = 'flex';
  181.  
  182. { public type signatures }
  183.     cmSigCurveType                = 'curv';
  184.     cmSigDataType                = 'data';
  185.     cmSigDateTimeType            = 'dtim';
  186.     cmSigLut16Type                = 'mft2';
  187.     cmSigLut8Type                = 'mft1';
  188.     cmSigMeasurementType        = 'meas';
  189.     cmSigNamedColorType            = 'ncol';
  190.     cmSigNamedColor2Type        = 'ncl2';
  191.     cmSigProfileDescriptionType    = 'desc';
  192.     cmSigScreeningType            = 'scrn';
  193.     cmSigS15Fixed16Type            = 'sf32';
  194.     cmSigSignatureType            = 'sig ';
  195.     cmSigTextType                = 'text';
  196.     cmSigU16Fixed16Type            = 'uf32';
  197.     cmSigU1Fixed15Type            = 'uf16';
  198.     cmSigUInt32Type                = 'ui32';
  199.     cmSigUInt64Type                = 'ui64';
  200.     cmSigUInt8Type                = 'ui08';
  201.     cmSigViewingConditionsType    = 'view';
  202.     cmSigXYZType                = 'XYZ ';
  203.  
  204. { custom type signatures }
  205.     cmSigVideoCardGammaType        = 'vcgt';
  206.  
  207.  
  208. { Measurement type encodings }
  209. { Measurement Flare }
  210.     cmFlare0                    = $00000000;
  211.     cmFlare100                    = $00000001;
  212.  
  213. { Measurement Geometry    }
  214.     cmGeometryUnknown            = $00000000;
  215.     cmGeometry045or450            = $00000001;
  216.     cmGeometry0dord0            = $00000002;
  217.  
  218. { Standard Observer    }
  219.     cmStdobsUnknown                = $00000000;
  220.     cmStdobs1931TwoDegrees        = $00000001;
  221.     cmStdobs1964TenDegrees        = $00000002;
  222.  
  223. { Standard Illuminant }
  224.     cmIlluminantUnknown            = $00000000;
  225.     cmIlluminantD50                = $00000001;
  226.     cmIlluminantD65                = $00000002;
  227.     cmIlluminantD93                = $00000003;
  228.     cmIlluminantF2                = $00000004;
  229.     cmIlluminantD55                = $00000005;
  230.     cmIlluminantA                = $00000006;
  231.     cmIlluminantEquiPower        = $00000007;
  232.     cmIlluminantF8                = $00000008;
  233.  
  234. { Spot Function Value }
  235.     cmSpotFunctionUnknown        = 0;
  236.     cmSpotFunctionDefault        = 1;
  237.     cmSpotFunctionRound            = 2;
  238.     cmSpotFunctionDiamond        = 3;
  239.     cmSpotFunctionEllipse        = 4;
  240.     cmSpotFunctionLine            = 5;
  241.     cmSpotFunctionSquare        = 6;
  242.     cmSpotFunctionCross            = 7;
  243.  
  244. { Color Space Signatures }
  245.     cmXYZData                    = 'XYZ ';
  246.     cmLabData                    = 'Lab ';
  247.     cmLuvData                    = 'Luv ';
  248.     cmYxyData                    = 'Yxy ';
  249.     cmRGBData                    = 'RGB ';
  250.     cmGrayData                    = 'GRAY';
  251.     cmHSVData                    = 'HSV ';
  252.     cmHLSData                    = 'HLS ';
  253.     cmCMYKData                    = 'CMYK';
  254.     cmCMYData                    = 'CMY ';
  255.     cmMCH5Data                    = 'MCH5';
  256.     cmMCH6Data                    = 'MCH6';
  257.     cmMCH7Data                    = 'MCH7';
  258.     cmMCH8Data                    = 'MCH8';
  259.     cmNamedData                    = 'NAME';
  260.  
  261. { profileClass enumerations }
  262.     cmInputClass                = 'scnr';
  263.     cmDisplayClass                = 'mntr';
  264.     cmOutputClass                = 'prtr';
  265.     cmLinkClass                    = 'link';
  266.     cmAbstractClass                = 'abst';
  267.     cmColorSpaceClass            = 'spac';
  268.     cmNamedColorClass            = 'nmcl';
  269.  
  270. { platform enumerations }
  271.     cmMacintosh                    = 'APPL';
  272.     cmMicrosoft                    = 'MSFT';
  273.     cmSolaris                    = 'SUNW';
  274.     cmSiliconGraphics            = 'SGI ';
  275.     cmTaligent                    = 'TGNT';
  276.  
  277. { ColorSync 1.0 elements }
  278.     cmCS1ChromTag                = 'chrm';
  279.     cmCS1TRCTag                    = 'trc ';
  280.     cmCS1NameTag                = 'name';
  281.     cmCS1CustTag                = 'cust';
  282.  
  283. { General element data types }
  284.  
  285. TYPE
  286.     CMDateTimePtr = ^CMDateTime;
  287.     CMDateTime = RECORD
  288.         year:                    UInt16;
  289.         month:                    UInt16;
  290.         dayOfTheMonth:            UInt16;
  291.         hours:                    UInt16;
  292.         minutes:                UInt16;
  293.         seconds:                UInt16;
  294.     END;
  295.  
  296.     CMFixedXYZColorPtr = ^CMFixedXYZColor;
  297.     CMFixedXYZColor = RECORD
  298.         X:                        Fixed;
  299.         Y:                        Fixed;
  300.         Z:                        Fixed;
  301.     END;
  302.  
  303.     CMXYZComponent                        = UInt16;
  304.     CMXYZColorPtr = ^CMXYZColor;
  305.     CMXYZColor = RECORD
  306.         X:                        CMXYZComponent;
  307.         Y:                        CMXYZComponent;
  308.         Z:                        CMXYZComponent;
  309.     END;
  310.  
  311.     CM2HeaderPtr = ^CM2Header;
  312.     CM2Header = RECORD
  313.         size:                    UInt32;                                    {  This is the total size of the Profile  }
  314.         CMMType:                OSType;                                    {  CMM signature,  Registered with CS2 consortium   }
  315.         profileVersion:            UInt32;                                    {  Version of CMProfile format  }
  316.         profileClass:            OSType;                                    {  input, display, output, devicelink, abstract, or color conversion profile type  }
  317.         dataColorSpace:            OSType;                                    {  color space of data  }
  318.         profileConnectionSpace:    OSType;                                    {  profile connection color space  }
  319.         dateTime:                CMDateTime;                                {  date and time of profile creation  }
  320.         CS2profileSignature:    OSType;                                    {  'acsp' constant ColorSync 2.0 file ID  }
  321.         platform:                OSType;                                    {  primary profile platform, Registered with CS2 consortium  }
  322.         flags:                    UInt32;                                    {  profile flags  }
  323.         deviceManufacturer:        OSType;                                    {  Registered with ICC consortium  }
  324.         deviceModel:            UInt32;                                    {  Registered with ICC consortium  }
  325.         deviceAttributes:        ARRAY [0..1] OF UInt32;                    {  Attributes like paper type  }
  326.         renderingIntent:        UInt32;                                    {  preferred rendering intent of tagged object  }
  327.         white:                    CMFixedXYZColor;                        {  profile illuminant  }
  328.         creator:                OSType;                                    {  profile creator  }
  329.         reserved:                PACKED ARRAY [0..43] OF CHAR;            {  reserved for future use  }
  330.     END;
  331.  
  332.     CMTagRecordPtr = ^CMTagRecord;
  333.     CMTagRecord = RECORD
  334.         tag:                    OSType;                                    {  Registered with CS2 consortium  }
  335.         elementOffset:            UInt32;                                    {  Relative to start of CMProfile  }
  336.         elementSize:            UInt32;
  337.     END;
  338.  
  339.     CMTagElemTablePtr = ^CMTagElemTable;
  340.     CMTagElemTable = RECORD
  341.         count:                    UInt32;
  342.         tagList:                ARRAY [0..0] OF CMTagRecord;            {  Variable size  }
  343.     END;
  344.  
  345. { External 0x02002001 CMProfile }
  346.     CM2ProfilePtr = ^CM2Profile;
  347.     CM2Profile = RECORD
  348.         header:                    CM2Header;
  349.         tagTable:                CMTagElemTable;
  350.         elemData:                SInt8;                                    {  Tagged element storage. Variable size  }
  351.     END;
  352.  
  353.     CM2ProfileHandle                    = ^CM2ProfilePtr;
  354. { Tag Type Definitions }
  355.     CMCurveTypePtr = ^CMCurveType;
  356.     CMCurveType = RECORD
  357.         typeDescriptor:            OSType;                                    {  'curv'  }
  358.         reserved:                UInt32;                                    {  fill with 0x00  }
  359.         countValue:                UInt32;                                    {  number of entries in table that follows  }
  360.         data:                    ARRAY [0..0] OF UInt16;                    {  Tagged element storage. Variable size  }
  361.     END;
  362.  
  363.     CMDataTypePtr = ^CMDataType;
  364.     CMDataType = RECORD
  365.         typeDescriptor:            OSType;                                    {  'data'  }
  366.         reserved:                UInt32;                                    {  fill with 0x00  }
  367.         dataFlag:                UInt32;                                    {  0 = ASCII, 1 = binary  }
  368.         data:                    SInt8;                                    {  Tagged element storage. Variable size  }
  369.     END;
  370.  
  371.     CMDateTimeTypePtr = ^CMDateTimeType;
  372.     CMDateTimeType = RECORD
  373.         typeDescriptor:            OSType;                                    {  'dtim'  }
  374.         reserved:                UInt32;
  375.         dateTime:                CMDateTime;
  376.     END;
  377.  
  378.     CMLut16TypePtr = ^CMLut16Type;
  379.     CMLut16Type = RECORD
  380.         typeDescriptor:            OSType;                                    {  'mft2'  }
  381.         reserved:                UInt32;                                    {  fill with 0x00  }
  382.         inputChannels:            SInt8;                                    {  Number of input channels  }
  383.         outputChannels:            SInt8;                                    {  Number of output channels  }
  384.         gridPoints:                SInt8;                                    {  Number of clutTable grid points  }
  385.         reserved2:                SInt8;                                    {  fill with 0x00  }
  386.         matrix:                    ARRAY [0..2,0..2] OF Fixed;                {   }
  387.         inputTableEntries:        UInt16;                                    {   }
  388.         outputTableEntries:        UInt16;                                    {   }
  389.         inputTable:                ARRAY [0..0] OF UInt16;                    {  Variable size  }
  390.         CLUT:                    ARRAY [0..0] OF UInt16;                    {  Variable size  }
  391.         outputTable:            ARRAY [0..0] OF UInt16;                    {  Variable size  }
  392.     END;
  393.  
  394.     CMLut8TypePtr = ^CMLut8Type;
  395.     CMLut8Type = RECORD
  396.         typeDescriptor:            OSType;                                    {  'mft1'  }
  397.         reserved:                UInt32;                                    {  fill with 0x00  }
  398.         inputChannels:            SInt8;                                    {   }
  399.         outputChannels:            SInt8;                                    {   }
  400.         gridPoints:                SInt8;                                    {   }
  401.         reserved2:                SInt8;                                    {  fill with 0x00  }
  402.         matrix:                    ARRAY [0..2,0..2] OF Fixed;                {   }
  403.         inputTable:                PACKED ARRAY [0..255] OF UInt8;            {  fixed size of 256  }
  404.         CLUT:                    PACKED ARRAY [0..1] OF UInt8;            {  Variable size  }
  405.         outputTable:            PACKED ARRAY [0..255] OF UInt8;            {  fixed size of 256  }
  406.     END;
  407.  
  408.     CMMeasurementTypePtr = ^CMMeasurementType;
  409.     CMMeasurementType = RECORD
  410.         typeDescriptor:            OSType;                                    {  'meas'  }
  411.         reserved:                UInt32;                                    {  fill with 0x00  }
  412.         standardObserver:        UInt32;                                    {  0 : unknown, 1 : CIE 1931, 2 : CIE 1964  }
  413.         backingXYZ:                CMFixedXYZColor;                        {  absolute XYZ values of backing  }
  414.         geometry:                UInt32;                                    {  0 : unknown, 1 : 0/45 or 45/0, 2 :0/d or d/0  }
  415.         flare:                    UInt32;                                    {  0 : 0%, 1 : 100% flare  }
  416.         illuminant:                UInt32;                                    {  standard illuminant  }
  417.     END;
  418.  
  419.     CMNamedColorTypePtr = ^CMNamedColorType;
  420.     CMNamedColorType = RECORD
  421.         typeDescriptor:            OSType;                                    {  'ncol'  }
  422.         reserved:                UInt32;                                    {  fill with 0x00  }
  423.         vendorFlag:                UInt32;                                    {   }
  424.         count:                    UInt32;                                    {  count of named colors in array that follows  }
  425.         prefixName:                SInt8;                                    {  Variable size, max = 32, to access fields after this one, have to count bytes  }
  426.         suffixName:                SInt8;                                    {  Variable size, max = 32  }
  427.         data:                    SInt8;                                    {  varaible size data as explained below  }
  428.     END;
  429.  
  430. {    
  431.     A variable size array of structs appears as the last block of data
  432.     in the above struct, CMNamedColorType.  The data structure
  433.     is as follows: (example in C)
  434.     
  435.     struct (                                             
  436.         unsigned char    rootName[1];                 * Variable size, max = 32 
  437.         unsigned char    colorCoords[1];                 * Variable size  
  438.     ) colorName[1];                                     * Variable size  
  439. }
  440.     CMNamedColor2TypePtr = ^CMNamedColor2Type;
  441.     CMNamedColor2Type = RECORD
  442.         typeDescriptor:            OSType;                                    {  'ncl2'  }
  443.         reserved:                UInt32;                                    {  fill with 0x00  }
  444.         vendorFlag:                UInt32;                                    {  lower 16 bits reserved for ICC use  }
  445.         count:                    UInt32;                                    {  count of named colors in array that follows  }
  446.         deviceChannelCount:        UInt32;                                    {  number of device channels, 0 indicates no device value available  }
  447.         prefixName:                PACKED ARRAY [0..31] OF UInt8;            {  32 byte field.  7 bit ASCII null terminated  }
  448.         suffixName:                PACKED ARRAY [0..31] OF UInt8;            {  32 byte field.  7 bit ASCII null terminated  }
  449.         data:                    SInt8;                                    {  varaible size data as explained below  }
  450.     END;
  451.  
  452. {    
  453.     A variable size array of structs appears as the last block of data
  454.     in the above struct, CMNamedColor2Type.  The data structure
  455.     is as follows: (example in C)
  456.     
  457.     struct (                                             
  458.         unsigned char    rootName[1];                 * 32 byte field.  7 bit ASCII null terminated
  459.         unsigned char    PCSColorCoords[1];             * Variable size  
  460.         unsigned char    DeviceColorCoords[1];         * Variable size  
  461.     ) colorName2[1];                                 * Variable size  
  462. }
  463.  
  464.     CMTextDescriptionTypePtr = ^CMTextDescriptionType;
  465.     CMTextDescriptionType = PACKED RECORD
  466.         typeDescriptor:            OSType;                                    {  'desc'  }
  467.         reserved:                UInt32;                                    {  fill with 0x00  }
  468.         ASCIICount:                UInt32;                                    {  the count of "bytes"  }
  469.         ASCIIName:                PACKED ARRAY [0..1] OF UInt8;            {  Variable size, to access fields after this one, have to count bytes  }
  470.         UniCodeCode:            UInt32;
  471.         UniCodeCount:            UInt32;                                    {  the count of characters, each character has two bytes  }
  472.         UniCodeName:            PACKED ARRAY [0..1] OF UInt8;            {  Variable size  }
  473.         ScriptCodeCode:            INTEGER;
  474.         ScriptCodeCount:        UInt8;                                    {  the count of "bytes"  }
  475.         ScriptCodeName:            PACKED ARRAY [0..1] OF UInt8;            {  Variable size  }
  476.     END;
  477.  
  478.     CMTextTypePtr = ^CMTextType;
  479.     CMTextType = RECORD
  480.         typeDescriptor:            OSType;                                    {  'text'  }
  481.         reserved:                UInt32;                                    {  fill with 0x00  }
  482.         text:                    SInt8;                                    {  count of text is obtained from tag size element  }
  483.     END;
  484.  
  485.     CMScreeningTypePtr = ^CMScreeningType;
  486.     CMScreeningType = RECORD
  487.         typeDescriptor:            OSType;                                    {  'scrn'  }
  488.         reserved:                UInt32;                                    {  fill with 0x00  }
  489.         screeningFlag:            UInt32;                                    {  bit 0 : use printer default screens, bit 1 : inch/cm  }
  490.         channelCount:            UInt32;
  491.         data:                    SInt8;                                    {  varaible size data as explained below  }
  492.     END;
  493.  
  494. {
  495.     A variable size array of structs appears as the last block of data
  496.     in the above struct, CMScreeningType.  The data structure
  497.     is as follows: (example in C)
  498.     
  499.     struct (
  500.         Fixed            frequency;
  501.         Fixed            angle;
  502.         unsigned long    sportFunction;
  503.      )    channelScreening[1];                        * Variable size 
  504. }
  505.     CMSignatureTypePtr = ^CMSignatureType;
  506.     CMSignatureType = RECORD
  507.         typeDescriptor:            OSType;                                    {  'sig '  }
  508.         reserved:                UInt32;                                    {  fill with 0x00  }
  509.         signature:                OSType;
  510.     END;
  511.  
  512.     CMS15Fixed16ArrayTypePtr = ^CMS15Fixed16ArrayType;
  513.     CMS15Fixed16ArrayType = RECORD
  514.         typeDescriptor:            OSType;                                    {  'sf32'  }
  515.         reserved:                UInt32;                                    {  fill with 0x00  }
  516.         value:                    ARRAY [0..0] OF Fixed;                    {  Variable size  }
  517.     END;
  518.  
  519.     CMU16Fixed16ArrayTypePtr = ^CMU16Fixed16ArrayType;
  520.     CMU16Fixed16ArrayType = RECORD
  521.         typeDescriptor:            OSType;                                    {  'uf32'  }
  522.         reserved:                UInt32;                                    {  fill with 0x00  }
  523.         value:                    ARRAY [0..0] OF UInt32;                    {  Variable size  }
  524.     END;
  525.  
  526.     CMUInt16ArrayTypePtr = ^CMUInt16ArrayType;
  527.     CMUInt16ArrayType = RECORD
  528.         typeDescriptor:            OSType;                                    {  'ui16'  }
  529.         reserved:                UInt32;                                    {  fill with 0x00  }
  530.         value:                    ARRAY [0..0] OF UInt16;                    {  Variable size  }
  531.     END;
  532.  
  533.     CMUInt32ArrayTypePtr = ^CMUInt32ArrayType;
  534.     CMUInt32ArrayType = RECORD
  535.         typeDescriptor:            OSType;                                    {  'ui32'  }
  536.         reserved:                UInt32;                                    {  fill with 0x00  }
  537.         value:                    ARRAY [0..0] OF UInt32;                    {  Variable size  }
  538.     END;
  539.  
  540.     CMUInt64ArrayTypePtr = ^CMUInt64ArrayType;
  541.     CMUInt64ArrayType = RECORD
  542.         typeDescriptor:            OSType;                                    {  'ui64'  }
  543.         reserved:                UInt32;                                    {  fill with 0x00  }
  544.         value:                    ARRAY [0..0] OF UInt32;                    {  Variable size (x2)  }
  545.     END;
  546.  
  547.     CMUInt8ArrayTypePtr = ^CMUInt8ArrayType;
  548.     CMUInt8ArrayType = RECORD
  549.         typeDescriptor:            OSType;                                    {  'ui08'  }
  550.         reserved:                UInt32;                                    {  fill with 0x00  }
  551.         value:                    SInt8;                                    {  Variable size  }
  552.     END;
  553.  
  554.     CMViewingConditionsTypePtr = ^CMViewingConditionsType;
  555.     CMViewingConditionsType = RECORD
  556.         typeDescriptor:            OSType;                                    {  'view'  }
  557.         reserved:                UInt32;                                    {  fill with 0x00  }
  558.         illuminant:                CMFixedXYZColor;                        {  absolute XYZs of illuminant  in cd/m^2  }
  559.         surround:                CMFixedXYZColor;                        {  absolute XYZs of surround in cd/m^2  }
  560.         stdIlluminant:            UInt32;                                    {  see definitions of std illuminants  }
  561.     END;
  562.  
  563.     CMXYZTypePtr = ^CMXYZType;
  564.     CMXYZType = RECORD
  565.         typeDescriptor:            OSType;                                    {  'XYZ '  }
  566.         reserved:                UInt32;                                    {  fill with 0x00  }
  567.         XYZ:                    ARRAY [0..0] OF CMFixedXYZColor;        {  variable size XYZ tristimulus values  }
  568.     END;
  569.  
  570. { Profile sequence description type }
  571.     CMProfileSequenceDescTypePtr = ^CMProfileSequenceDescType;
  572.     CMProfileSequenceDescType = RECORD
  573.         typeDescriptor:            OSType;                                    {  'pseq '  }
  574.         reserved:                UInt32;                                    {  fill with 0x00  }
  575.         count:                    UInt32;                                    {  Number of descriptions  }
  576.         data:                    SInt8;                                    {  varaible size data as explained below  }
  577.     END;
  578.  
  579. {
  580.     A variable size array of structs appears as the last block of data
  581.     in the above struct, CMProfileSequenceDescType.  The data structure
  582.     is as follows: (example in C)
  583.     
  584.     struct (                                             
  585.         OSType            deviceMfg;                     * Device Manufacturer 
  586.         OSType            deviceModel;                 * Decvice Model 
  587.         unsigned long    attributes[2];                 * Device attributes 
  588.         OSType            technology;                     * Technology signature 
  589.         unsigned long    mfgDescASCIICount;             * the count of "bytes" 
  590.         unsigned char    mfgDescASCIIName[2];         * Variable size 
  591.         unsigned long    mfgDescUniCodeCode;             
  592.         unsigned long    mfgDescUniCodeCount;         * the count of characters, each character has two bytes 
  593.         unsigned char    mfgDescUniCodeName[2];         * Variable size 
  594.         unsigned long    mfgDescScriptCodeCode;         
  595.         unsigned long    mfgDescScriptCodeCount;         * the count of "bytes" 
  596.         unsigned char    mfgDescScriptCodeName[2];     * Variable size 
  597.         unsigned long    modelDescASCIICount;         * the count of "bytes" 
  598.         unsigned char    modelDescASCIIName[2];         * Variable size 
  599.         unsigned long    modelDescUniCodeCode;         
  600.         unsigned long    modelDescUniCodeCount;         * the count of characters, each character has two bytes 
  601.         unsigned char    modelDescUniCodeName[2];     * Variable size 
  602.         short            modelDescScriptCodeCode;     
  603.         unsigned char    modelDescScriptCodeCount;     * the count of "bytes" 
  604.         SInt8            filler;                         * For proper alignment across languages 
  605.         unsigned char    modelDescScriptCodeName[2];     * Variable size 
  606.     )    profileDescription[1];                         
  607. }
  608.  
  609. { Under color removal, black generation type }
  610.     CMUcrBgTypePtr = ^CMUcrBgType;
  611.     CMUcrBgType = RECORD
  612.         typeDescriptor:            OSType;                                    {  'bfd  '  }
  613.         reserved:                UInt32;                                    {  fill with 0x00  }
  614.         ucrCount:                UInt32;                                    {  Number of UCR entries  }
  615.         ucrValues:                ARRAY [0..0] OF UInt16;                    {  variable size  }
  616.         bgCount:                UInt32;                                    {  Number of BG entries  }
  617.         bgValues:                ARRAY [0..0] OF UInt16;                    {  variable size  }
  618.         ucrbgASCII:                SInt8;                                    {  null terminated ASCII string  }
  619.     END;
  620.  
  621.     CMIntentCRDVMSizePtr = ^CMIntentCRDVMSize;
  622.     CMIntentCRDVMSize = RECORD
  623.         renderingIntent:        LONGINT;                                {  rendering intent  }
  624.         VMSize:                    UInt32;                                    {  VM size taken up by the CRD  }
  625.     END;
  626.  
  627.     CMPS2CRDVMSizeTypePtr = ^CMPS2CRDVMSizeType;
  628.     CMPS2CRDVMSizeType = RECORD
  629.         typeDescriptor:            OSType;                                    {  'psvm'  }
  630.         reserved:                UInt32;                                    {  fill with 0x00  }
  631.         count:                    UInt32;                                    {  number of intent entries  }
  632.         intentCRD:                ARRAY [0..0] OF CMIntentCRDVMSize;        {  variable size  }
  633.     END;
  634.  
  635. { Video Card Gamma type }
  636.  
  637. CONST
  638.     cmVideoCardGammaTableType    = 0;
  639.     cmVideoCardGammaFormulaType    = 1;
  640.  
  641.  
  642.  
  643. TYPE
  644.     CMVideoCardGammaTablePtr = ^CMVideoCardGammaTable;
  645.     CMVideoCardGammaTable = RECORD
  646.         channels:                UInt16;                                    {  # of gamma channels (1 or 3)  }
  647.         entryCount:                UInt16;                                    {  1-based number of entries per channel  }
  648.         entrySize:                UInt16;                                    {  size on bytes of each entry  }
  649.         data:                    SInt8;                                    {  variable size data follows  }
  650.     END;
  651.  
  652.     CMVideoCardGammaFormulaPtr = ^CMVideoCardGammaFormula;
  653.     CMVideoCardGammaFormula = RECORD
  654.         redGamma:                Fixed;                                    {  must be > 0.0  }
  655.         redMin:                    Fixed;                                    {  must be > 0.0 and < 1.0  }
  656.         redMax:                    Fixed;                                    {  must be > 0.0 and < 1.0  }
  657.         greenGamma:                Fixed;                                    {  must be > 0.0  }
  658.         greenMin:                Fixed;                                    {  must be > 0.0 and < 1.0  }
  659.         greenMax:                Fixed;                                    {  must be > 0.0 and < 1.0  }
  660.         blueGamma:                Fixed;                                    {  must be > 0.0  }
  661.         blueMin:                Fixed;                                    {  must be > 0.0 and < 1.0  }
  662.         blueMax:                Fixed;                                    {  must be > 0.0 and < 1.0  }
  663.     END;
  664.  
  665.     CMVideoCardGammaPtr = ^CMVideoCardGamma;
  666.     CMVideoCardGamma = RECORD
  667.         tagType:                UInt32;
  668.         CASE INTEGER OF
  669.         0: (
  670.             table:                CMVideoCardGammaTable;
  671.             );
  672.         1: (
  673.             formula:            CMVideoCardGammaFormula;
  674.             );
  675.     END;
  676.  
  677.     CMVideoCardGammaTypePtr = ^CMVideoCardGammaType;
  678.     CMVideoCardGammaType = RECORD
  679.         typeDescriptor:            OSType;                                    {  'vcgt'  }
  680.         reserved:                UInt32;                                    {  fill with 0x00  }
  681.         gamma:                    CMVideoCardGamma;
  682.     END;
  683.  
  684. {**********************************************************************}
  685. {************** ColorSync 1.0 profile specification *******************}
  686. {**********************************************************************}
  687.  
  688. CONST
  689.     cmGrayResponse                = 0;
  690.     cmRedResponse                = 1;
  691.     cmGreenResponse                = 2;
  692.     cmBlueResponse                = 3;
  693.     cmCyanResponse                = 4;
  694.     cmMagentaResponse            = 5;
  695.     cmYellowResponse            = 6;
  696.     cmUcrResponse                = 7;
  697.     cmBgResponse                = 8;
  698.     cmOnePlusLastResponse        = 9;
  699.  
  700.  
  701. { Device types }
  702.     cmMonitorDevice                = 'mntr';
  703.     cmScannerDevice                = 'scnr';
  704.     cmPrinterDevice                = 'prtr';
  705.  
  706.  
  707.  
  708. TYPE
  709.     CMIStringPtr = ^CMIString;
  710.     CMIString = RECORD
  711.         theScript:                ScriptCode;
  712.         theString:                Str63;
  713.     END;
  714.  
  715. { Profile options }
  716.  
  717. CONST
  718.     cmPerceptualMatch            = $0000;                        {  Default. For photographic images  }
  719.     cmColorimetricMatch            = $0001;                        {  Exact matching when possible  }
  720.     cmSaturationMatch            = $0002;                        {  For solid colors  }
  721.  
  722. { Profile flags }
  723.     cmNativeMatchingPreferred    = $00000001;                    {  Default to native not preferred  }
  724.     cmTurnOffCache                = $00000002;                    {  Default to turn on CMM cache  }
  725.  
  726.  
  727. TYPE
  728.     CMMatchOption                        = LONGINT;
  729.     CMMatchFlag                            = LONGINT;
  730.     CMHeaderPtr = ^CMHeader;
  731.     CMHeader = RECORD
  732.         size:                    UInt32;
  733.         CMMType:                OSType;
  734.         applProfileVersion:        UInt32;
  735.         dataType:                OSType;
  736.         deviceType:                OSType;
  737.         deviceManufacturer:        OSType;
  738.         deviceModel:            UInt32;
  739.         deviceAttributes:        ARRAY [0..1] OF UInt32;
  740.         profileNameOffset:        UInt32;
  741.         customDataOffset:        UInt32;
  742.         flags:                    CMMatchFlag;
  743.         options:                CMMatchOption;
  744.         white:                    CMXYZColor;
  745.         black:                    CMXYZColor;
  746.     END;
  747.  
  748.     CMProfileChromaticitiesPtr = ^CMProfileChromaticities;
  749.     CMProfileChromaticities = RECORD
  750.         red:                    CMXYZColor;
  751.         green:                    CMXYZColor;
  752.         blue:                    CMXYZColor;
  753.         cyan:                    CMXYZColor;
  754.         magenta:                CMXYZColor;
  755.         yellow:                    CMXYZColor;
  756.     END;
  757.  
  758.     CMProfileResponsePtr = ^CMProfileResponse;
  759.     CMProfileResponse = RECORD
  760.         counts:                    ARRAY [0..8] OF UInt16;
  761.         data:                    ARRAY [0..0] OF UInt16;                    {  Variable size  }
  762.     END;
  763.  
  764.     CMProfilePtr = ^CMProfile;
  765.     CMProfile = RECORD
  766.         header:                    CMHeader;
  767.         profile:                CMProfileChromaticities;
  768.         response:                CMProfileResponse;
  769.         profileName:            CMIString;
  770.         customData:                SInt8;                                    {  Variable size  }
  771.     END;
  772.  
  773.     CMProfileHandle                        = ^CMProfilePtr;
  774. {$IFC OLDROUTINENAMES }
  775.  
  776. CONST
  777.     kCMApplProfileVersion        = $00000100;
  778.  
  779.     grayResponse                = 0;
  780.     redResponse                    = 1;
  781.     greenResponse                = 2;
  782.     blueResponse                = 3;
  783.     cyanResponse                = 4;
  784.     magentaResponse                = 5;
  785.     yellowResponse                = 6;
  786.     ucrResponse                    = 7;
  787.     bgResponse                    = 8;
  788.     onePlusLastResponse            = 9;
  789.  
  790.     rgbData                        = 'RGB ';
  791.     cmykData                    = 'CMYK';
  792.     grayData                    = 'GRAY';
  793.     xyzData                        = 'XYZ ';
  794.  
  795.     monitorDevice                = 'mntr';
  796.     scannerDevice                = 'scnr';
  797.     printerDevice                = 'prtr';
  798.  
  799.  
  800. TYPE
  801.     XYZComponent                        = UInt16;
  802.     XYZColor                            = CMXYZColor;
  803.     XYZColorPtr                         = ^XYZColor;
  804.     CMResponseData                        = UInt16;
  805.     IString                                = CMIString;
  806.     IStringPtr                             = ^IString;
  807.     CMResponseColor                        = LONGINT;
  808.     responseColor                        = CMResponseColor;
  809. {$ENDC}  {OLDROUTINENAMES}
  810.  
  811.  
  812. {$ALIGN RESET}
  813. {$POP}
  814.  
  815. {$SETC UsingIncludes := CMICCProfileIncludes}
  816.  
  817. {$ENDC} {__CMICCPROFILE__}
  818.  
  819. {$IFC NOT UsingIncludes}
  820.  END.
  821. {$ENDC}
  822.